//
//  HWHomeBannerItemView.swift
//  HWanGame
//
//  Created by 王昌健 on 2021/12/27.
//  Copyright © 2021 94Wan. All rights reserved.
//

import UIKit

class HWHomeBannerItemView: UIView {
    var imageView:UIImageView!
    var nameLabel:UILabel!
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        initUI()
        
        initFrame()
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
    }

}

extension HWHomeBannerItemView {
    private func initUI() -> Void {
        backgroundColor = .white
        imageView = UIImageView()
        addSubview(imageView)
        
        nameLabel = HWLabel.createBoldLabel(title: "", color: "#333333", font: 11*widthScale)
        addSubview(nameLabel)
    }
    
    private func initFrame() -> Void {
        imageView.snp.makeConstraints { make in
            make.top.equalTo(0)
            make.centerX.equalToSuperview()
            make.width.height.equalTo(42*widthScale)
        }
        
        nameLabel.snp.makeConstraints { make in
            make.top.equalTo(imageView.snp.bottom).offset(5*widthScale)
            make.height.equalTo(15*widthScale)
            make.centerX.equalToSuperview()
        }
    }
}
